﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Ppt = Microsoft.Office.Interop.PowerPoint;

namespace ObjectModel.PowerPoint
{
    /// <summary>
    /// A PowerPoint slide object that can resolve itself from serializable info.
    /// </summary>
    public class ResolvableSlide : ResolvableObject
    {
        public int Id { get; set; }

        [XmlIgnore]
        public Ppt.Presentation Presentation { get { return Globals.Application.ActivePresentation; } }

        public ResolvableSlide() { } // Parameterless constructor required for serialization.

        public ResolvableSlide(Ppt.Slide slide)
        {
            Id = slide.SlideID;
        }

        public override object Resolve()
        {
            return Presentation.Slides.FindBySlideID(Id);
        }
    }
}
